Skip to main content

Overview

Administrators have elevated permissions to manage the entire Iquea Commerce platform. This guide covers admin-specific features for product management, category organization, order processing, and inventory control.
Admin features are only accessible to users with role ADMIN. Regular customers with role CLIENTE do not have access to these functions.

Admin Authentication

Admin users authenticate through the same login system but have elevated privileges:

User Roles

RoleDescriptionPermissions
CLIENTERegular customerBrowse, purchase, view own orders
ADMINAdministratorFull CRUD on products, categories, view all orders
Admin status is determined by the rol field in the user account. This is set at the database level and cannot be self-assigned.

Managing Products

Administrators have full control over the product catalog through dedicated endpoints.

Viewing All Products

1

Access Product List

Navigate to the admin product management section
2

View Product Grid

All products are displayed with:
  • Product ID and SKU
  • Name and description
  • Category assignment
  • Price (amount and currency)
  • Dimensions (height × width × depth)
  • Featured status (es_destacado)
  • Current stock level
  • Product image
3

Filter and Search

Use admin filters to find products:
  • Search by name
  • Filter by category
  • Filter by price range
  • Filter by SKU
  • Show only featured products

Creating New Products

Add new items to the product catalog:
1

Open Create Product Form

Click “Add New Product” or “Crear Producto”
2

Fill Required Fields

Complete all required product information:Basic Information
  • SKU: Unique stock keeping unit code
  • Name (nombre): Product name
  • Description (descripcion): Detailed product description
Pricing
  • Price Amount (precioCantidad): Numeric price value
  • Currency (precioMoneda): Currency symbol (e.g., ”€”)
Dimensions
  • Height (dimensionesAlto): Height in cm
  • Width (dimensionesAncho): Width in cm
  • Depth (dimensionesProfundo): Depth in cm
Inventory
  • Stock: Number of units available
  • Featured (es_destacado): Mark as featured product
Media
  • Image URL (imagen_url): Product image URL
Categorization
  • Category: Select product category
3

Submit Product

Click “Create” to submit:
  • POST request to /api/productos
  • Product is validated and saved
  • Returns created product with assigned ID
4

Verify Creation

New product appears in product list and is immediately available to customers
The SKU must be unique across all products. Duplicate SKUs will cause creation to fail.

Updating Products

Modify existing product information:
1

Select Product to Edit

Click “Edit” on any product in the admin product list
2

Modify Fields

Update any product fields:
  • Change price
  • Update stock levels
  • Toggle featured status
  • Modify description
  • Update dimensions
  • Change category
  • Update image URL
3

Save Changes

Click “Update” or “Save”:
  • PUT request to /api/productos/sku/{sku}
  • Product is validated and updated
  • Changes are immediately reflected
Updating product prices does NOT affect existing orders. Orders lock prices at the time of purchase.

Deleting Products

Remove products from the catalog:
1

Select Product

Find the product you want to delete
2

Click Delete

Click “Delete” or trash icon button
3

Confirm Deletion

Confirm the deletion action in the dialog:
  • DELETE request to /api/productos/{id}
  • Product is permanently removed
4

Verify Removal

Product no longer appears in catalog or search results
Deleting products may affect existing orders that reference them. Consider marking products as out of stock instead of deletion.

Managing Categories

Organize products into logical categories for better navigation.

Viewing All Categories

Access the category management interface:
  • View list of all categories
  • See category name and slug
  • Check number of products per category

Creating Categories

1

Open Create Category Form

Click “Add Category” or “Nueva Categoría”
2

Enter Category Details

Fill in:
  • Name (nombre): Display name (e.g., “Salón”, “Dormitorio”)
  • Slug: URL-friendly identifier (e.g., “salon”, “dormitorio”)
3

Submit Category

Click “Create”:
  • POST request to /api/categorias
  • Category is created and available for product assignment

Updating Categories

Modify existing category information:
1

Select Category

Click “Edit” on a category
2

Update Fields

Change name or slug
3

Save Changes

Submit update:
  • PUT request to /api/categorias/{nombre}
  • Category is updated
  • All products in category reflect new name

Deleting Categories

1

Select Category

Choose category to delete
2

Delete Category

Click delete:
  • DELETE request to /api/categorias/{nombre}
  • Category is removed
Deleting a category may leave products without category assignment. Reassign products before deleting categories.

Viewing All Orders

Administrators can view and manage all customer orders.

Order Management Interface

1

Access Order Dashboard

Navigate to “Orders” or “Pedidos” in the admin panel
2

View All Orders

Unlike customers who see only their orders, admins see:
  • All orders from all customers
  • Order reference codes
  • Customer information
  • Order dates
  • Current status
  • Order totals
3

Filter Orders

Use filters to find specific orders:
  • By Status: GET /api/pedidos/estado/{estado}
  • By Customer: Filter by user ID
  • By Date: Filter by creation date range
  • By Reference: Search by reference code

Updating Order Status

Admins can manually change order status:
1

Select Order

Click on an order to view details
2

Change Status

Select new status from dropdown or buttons:
  • PENDIENTECONFIRMADO
  • CONFIRMADOENVIADO
  • ENVIADOENTREGADO
  • Any status → CANCELADO
3

Save Status Change

Submit update:
  • PUT request to /api/pedidos/{id}
  • Order status is updated
  • Customer sees new status

Viewing Order Details

Admins have full access to all order information:
  • Complete customer information
  • All line items with products
  • Pricing details (unit price, quantity, subtotals)
  • Order history and status changes
  • Shipping information

Modifying Orders

Admins can update order details:
1

Open Order Editor

Select order and click edit
2

Modify Order Details

Make changes:
  • Add items: POST /api/pedidos/{id}/detalles
  • Remove items: DELETE /api/detalles/{id}
  • Update quantities: PUT /api/detalles/{id}/cantidad?cantidad={qty}
3

Recalculate Total

Order total updates automatically based on detail changes
Modifying orders after confirmation may confuse customers. Consider cancelling and creating a new order instead.

Deleting Orders

Admins can permanently delete orders:
  • Click delete on order
  • Confirm deletion
  • DELETE request to /api/pedidos/{id}
  • Order and all details are removed
Deletion is permanent and cannot be undone. Use cancellation status instead when possible.

Inventory Management

Control product stock levels and availability.

Updating Stock Levels

1

Navigate to Product

Find product in admin product list
2

Edit Stock Field

Update the stock field with new inventory count
3

Save Changes

Submit product update:
  • Stock level is updated immediately
  • Products with stock = 0 show as “Agotado” to customers

Stock Visibility

  • Stock > 0: Product available for purchase, shows “X unidades”
  • Stock = 0: Product shows as “Agotado”, cannot be added to cart

Bulk Stock Updates

For updating multiple products:
  1. Use product filters to find items needing updates
  2. Update each product individually via API
  3. Consider batch import/export for large inventory changes
The platform does not currently have automated stock deduction on order placement. Admins must manually adjust inventory after processing orders.

Product Search and Filtering

Admins have access to advanced search endpoints:

Available Search Methods

EndpointDescriptionExample
/api/productos/buscar?nombre={text}Search by namenombre=sofá
/api/productos/precio?min={min}&max={max}Filter by price rangemin=100&max=1000
/api/productos/sku/{sku}Find by SKUsku=SOFA-001
/api/productos/destacadosGet featured products-
/api/productos/categoria/{id}Filter by categorycategoria/5

Admin Best Practices

Verify Before Deletion

Always verify that products/categories are not actively referenced before deletion. Check for existing orders.

Maintain Stock Accuracy

Regularly update stock levels to reflect actual inventory. Set stock to 0 for unavailable items rather than deleting.

Use Featured Products Strategically

Mark high-quality or promotional items as featured. Limit to 6-8 products for optimal homepage display.

Process Orders Promptly

Update order statuses in a timely manner so customers can track their purchases accurately.

Maintain Category Structure

Keep category names consistent and logical. Use singular or plural consistently across all categories.

Security Considerations

Role-Based Access

Admin functions are protected:
  • Backend validates user role before allowing admin operations
  • JWT tokens include role information
  • Unauthorized access returns 403 Forbidden

Data Validation

All admin operations validate:
  • Required fields are present
  • Data types are correct
  • Unique constraints (SKU, category names)
  • Referential integrity (categories exist)
Never share admin credentials. Use individual admin accounts with proper role assignments for accountability.

API Reference Summary

Product Endpoints (Admin)

  • POST /api/productos - Create product
  • PUT /api/productos/sku/{sku} - Update product by SKU
  • DELETE /api/productos/{id} - Delete product

Category Endpoints (Admin)

  • POST /api/categorias - Create category
  • PUT /api/categorias/{nombre} - Update category
  • DELETE /api/categorias/{nombre} - Delete category

Order Endpoints (Admin)

  • GET /api/pedidos - List all orders
  • GET /api/pedidos/estado/{estado} - Filter by status
  • PUT /api/pedidos/{id} - Update order
  • DELETE /api/pedidos/{id} - Delete order
  • POST /api/pedidos/{id}/detalles - Add order detail
  • DELETE /api/detalles/{id} - Remove order detail
  • PUT /api/detalles/{id}/cantidad - Update detail quantity

Troubleshooting

Cannot Access Admin Features

Problem: Admin options not visible Solution: Verify your account has rol: ADMIN. Contact a system administrator to update your role.

Product Creation Fails

Problem: Cannot create new product Common Causes:
  • Duplicate SKU (must be unique)
  • Missing required fields
  • Invalid category reference
  • Malformed image URL

Order Status Won’t Update

Problem: Order status update fails Solutions:
  • Verify order exists
  • Check status is valid enum value
  • Ensure you have admin permissions